import java.util.Scanner;

public class Test {
    //定义苹果8元一斤
    static final  int applePrice = 8;
    //定义草莓13元一斤
    static final  int strawberryPrice = 13;
    //定义芒果8元一斤
    static final  int mangoPrice = 20;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println( "输入折扣方式== 1:无折扣;2:草莓打八折;3:每满100-10");
        // 读取用户输入草莓斤数
        int code= scanner.nextInt();
        while (!(code ==1 || code ==2 || code ==3)){
            System.out.println( "输入有误,请重新输入");
            System.out.println( "输入折扣方式== 1:无折扣;2:草莓打八折;3:每满100-10");
            code= scanner.nextInt();
        }
        // 读取用户输入买苹果斤数
        System.out.println( "读取购买苹果斤数(整数)");
        int appleWeight = scanner.nextInt();

        System.out.println( "读取购买草莓斤数(整数)");
        // 读取用户输入草莓斤数
        int strawberryWeight= scanner.nextInt();

        System.out.println( "读取购买芒果斤数(整数)");
        // 读取用户输入草莓斤数
        int mangoPriceWeight= scanner.nextInt();

        calculateCost(appleWeight, strawberryWeight, mangoPriceWeight,code);

    }

    public static void calculateCost(int appleWeight, int strawberryWeight, int mangoWeight, int code) {

        int appleCost = applePrice * appleWeight;
        int strawberryCost = strawberryPrice * strawberryWeight;
        int mangoCost = mangoPrice * mangoWeight;
        switch(code) {
            case 1:
                int allCost=appleCost + strawberryCost + mangoCost;
                System.out.println("购买商品的总价 " +  allCost + " 元");
                break;
            case 2:

                double twentyPercentOffCost = appleCost + strawberryCost * 0.8 + mangoCost ;
                System.out.println("购买商品的总价 " + twentyPercentOffCost +" 元");
                break;
            case 3:
                int fullReductionCost = (appleCost + strawberryCost + mangoCost) - ((appleCost + strawberryCost + mangoCost)/100) * 10 ;
                System.out.println("购买商品的总价 " + fullReductionCost +" 元");
                break;
            default:
                System.out.println("Value is not 1, 2, or 3");
        }


    }
}
